home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 343_01 / create.c < prev    next >
C/C++ Source or Header  |  1992-04-09  |  1KB  |  54 lines

  1.  
  2.  
  3.        /************************************************
  4.        *
  5.        *       file d:\lsu\create.c
  6.        *
  7.        *       Functions: This file contains
  8.        *           main
  9.        *
  10.        *       Purpose:
  11.        *          This program creates an 8 bit tiff file 
  12.        *          of size l*ROWS by w*COLS.
  13.        *
  14.        *       External Calls:
  15.        *          wtiff.c - create_allocate_tiff_file
  16.        *
  17.        *       Modifications:
  18.        *          7 Arpil 1992 - created
  19.        *
  20.        *************************************************/
  21.  
  22.  
  23.  
  24. #include "d:\cips\cips.h"
  25.  
  26. short image[ROWS][COLS];
  27.  
  28. main(argc, argv)
  29.    int  argc;
  30.    char *argv[];
  31. {
  32.    int    l, w;
  33.    struct tiff_header_struct image_header;
  34.  
  35.    if(argc < 4 || argc > 4){
  36.       printf("\nusage: create file-name length width\n"
  37.              "\n       the program will multiply length and width"
  38.              "\n       by %d and %d", ROWS, COLS);
  39.       exit(-1);
  40.    }
  41.  
  42.    l = atoi(argv[2]);
  43.    w = atoi(argv[3]);
  44.  
  45.    image_header.lsb            = 1;
  46.    image_header.bits_per_pixel = 8;
  47.    image_header.image_length   = l*ROWS;
  48.    image_header.image_width    = w*COLS;;
  49.    image_header.strip_offset   = 1000;
  50.  
  51.    create_allocate_tiff_file(argv[1], &image_header, image);
  52.  
  53. }
  54.